//
//  ZYMessage.m
//  YiLin
//
//  Created by Zyark on 2018/6/2.
//  Copyright © 2018年 Zyark. All rights reserved.
//

#import "ZYMessage.h"

@implementation ZYMessage
+ (NSDictionary *)modelCustomPropertyMapper {
    return @{
             @"message" : @[@"context",@"description"],
             @"createTime" : @"createTime",
             @"messageId" : @"id",
             @"isRead" : @"isRead"
             };
}
-(NSString *)dateStr{
    if(NULLString(_dateStr)){
        if(!NULLString(_createTime)){
            NSDate *date = [NSDate dateWithTimeIntervalSince1970:[_createTime doubleValue]];
            NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
            [formatter setDateFormat:@"yyyy-MM-dd HH:mm"];
            _dateStr = [formatter stringFromDate: date];
            return _dateStr;
        }
        return @"";
    }
    return _dateStr;
}
@end
